<template>
	<fs-page>
		<fs-crud ref="crudRef" v-bind="crudBinding"></fs-crud>
		<!-- 新增抽屉组件 -->
		<subTrading ref="subTradingRef" @close="handleChildClose"></subTrading>
	</fs-page>
</template>

<script lang="ts" setup name="tradingPairs">
import { onMounted, defineAsyncComponent,ref } from 'vue';
import { useFs } from '@fast-crud/fast-crud';
import { createCrudOptions } from './crud';
// 新增异步组件引入
const subTrading = defineAsyncComponent(() => import('./subTrading/index.vue'));
const subTradingRef = ref();

const { crudBinding, crudRef, crudExpose, crudOptions, resetCrudOptions } = useFs({ createCrudOptions,context: { subTradingRef }  });

// 页面打开后获取列表数据
onMounted(async () => {  
  crudExpose.doRefresh(); 
});

const handleChildClose = () => {
  crudExpose.doRefresh(); // 监听子组件关闭事件并刷新列表
}

</script>
 